# -*- coding:utf-8 -*-
'''
@Date:2022/10/3  20:56
@Author:一加一
'''

from tools.operate_config import OperateConfig
from urllib.parse import urljoin

class ApiPath:

    '''管理api地址'''

    def __init__(self,env=None):
        if env is None:
            self.env = OperateConfig().get_node_value('ENV', 'env')
        else:
            self.env = env

        self.gs_host_url = OperateConfig().get_node_value(self.env,'gs_host_url') # 读取配置文件config.ini的业务系统接口域名
        #self.gs_host_url = OperateConfig().get_node_value(self.env, 'gs_host_url') #读取配置文件config.ini 的gs_host域名




        #-----------------接口------------------
        #登录接口
        self.login = urljoin(self.gs_host_url, "/gst/broadcast/cms/login")   #登录
        self.s_exchangeToken_url = urljoin(self.login,"/")




        # 查询媒体库的音频文件列表
        self.queryMediaList = urljoin(self.gs_host_url, "/open-api/media/manage/queryMediaList")
        # 文件上传到设备
        self.audioUpload = urljoin(self.gs_host_url, "/open-api/device/operate/audioUpload")




        #【设备操作类】
        # 播放音频文件(√)
        self.audio_play = urljoin(self.gs_host_url, "/open-api/device/operate/audioPlay")
        # TTS播放(√)
        self.speechSynthesisPlay = urljoin(self.gs_host_url, "/open-api/device/operate/speechSynthesisPlay")
        #调节音量(√)
        self.volume_set = urljoin(self.gs_host_url, "/open-api/device/operate/volumeSet")
        #电源操作(√)
        self.relay_Operate = urljoin(self.gs_host_url,"/open-api/device/operate/relayOperate")
        #停止播放
        self.audio_stop = urljoin(self.gs_host_url,"/open-api/device/operate/audioStop")
        #告警灯下发
        self.light_Set = urljoin(self.gs_host_url,"/open-api/device/operate/lightModeSet")
        #删除设备端音频文件
        self.file_delete = urljoin(self.gs_host_url, "/open-api/device/operate/audioDelete")
        #重启设备
        self.reboot = urljoin(self.gs_host_url,"/open-api/device/operate/reboot")
        #开关屏操作
        self.switchScreen = urljoin(self.gs_host_url, "/open-api/device/operate/switchInfBoardScreen")
        #录音采集
        self.MicRecordCollection = urljoin(self.gs_host_url, "/open-api/device/operate/deviceMicRecordCollection")
        #情报板配置
        self.informationBoardSet = urljoin(self.gs_host_url, "/open-api/device/operate/informationBoardSet")







        #设备管理类
        # 情报板屏参配置
        self.updateInfoBoard = urljoin(self.gs_host_url, "/open-api/device/manage/updateInfoBoard")
        #获取情报板当前配置及显示内容
        self.queryInfoBoardInfo = urljoin(self.gs_host_url, "/open-api/device/manage/queryInfoBoardInfo")
        # 查询已上传的文件列表
        self.queryUploadAudioList = urljoin(self.gs_host_url, "/open-api/device/manage/queryUploadAudioList")
        #查询媒体库文件列表
        self.queryMediaList= urljoin(self.gs_host_url, "/open-api/media/manage/queryMediaList")
        # 查询设备列表
        self.queryDeviceList = urljoin(self.gs_host_url, "/open-api/device/manage/queryDeviceList")
        # 查询设备端录音采集文件列表
        self.queryDeviceRecordList = urljoin(self.gs_host_url, "/open-api/device/manage/queryDeviceRecordList")
        # 查询设备端录音采集文件信息
        self.queryDeviceRecordInfo = urljoin(self.gs_host_url, "/open-api/device/manage/queryDeviceRecordInfo")


















